<template>
	<view class="">
		<view class="add-target">
			<u-cell-item title="分科" value="语文" @click="showName = true"></u-cell-item>
			<u-field
				v-model="mobile"
				label="考试名称"
				input-align="right"
				placeholder="请填输入目标名称"
			>
			</u-field>
			<u-cell-item title="考试时间" value="2021.01.01" @click="showTime = true"></u-cell-item>
			<u-field
				v-model="mobile"
				label="总分排名"
				input-align="right"
				placeholder="请填输入排名"
			>
			</u-field>
		</view>
		<view class="add-target">
			<u-field
				v-model="mobile"
				label="语文"
				input-align="right"
				placeholder="请填输入分数"
			>
			</u-field>
			<u-field
				v-model="mobile"
				label="数学"
				input-align="right"
				placeholder="请填输入分数"
			>
			</u-field>
			<u-field
				v-model="mobile"
				label="英语"
				input-align="right"
				placeholder="请填输入分数"
			>
			</u-field>
			<u-field
				v-model="mobile"
				label="物理"
				input-align="right"
				placeholder="请填输入分数"
			>
			</u-field>
			<u-field
				v-model="mobile"
				label="化学"
				input-align="right"
				placeholder="请填输入分数"
			>
			</u-field>
			<u-field
				v-model="mobile"
				label="生物"
				input-align="right"
				placeholder="请填输入分数"
			>
			</u-field>
			<u-field
				v-model="mobile"
				label="政治"
				input-align="right"
				placeholder="请填输入分数"
			>
			</u-field>
			<u-field
				v-model="mobile"
				label="地理"
				input-align="right"
				placeholder="请填输入分数"
			>
			</u-field>
			<u-field
				v-model="mobile"
				label="历史"
				input-align="right"
				placeholder="请填输入分数"
			>
			</u-field>
		</view>
		
		<view class="add-target-btn">
			保存
		</view>
		
		<!-- <u-popup mode="bottom" v-model="showName">
			<scroll-view scroll-y="true" style="height: 300rpx;">
				<view class="show-name-title"><view>取消</view><view>选择科目</view><view>确认</view></view>
				<view>
					<view></view>
				</view>
			</scroll-view>
		</u-popup> -->
		<u-select v-model="showName" :list="list" @confirm="confirm"></u-select>
		<u-calendar v-model="showTime" :mode="mode" active-bg-color="#19be6b" btn-type="success"></u-calendar>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				showName: false,
				showTime: false,
				mode: 'date',
				list: [
					{
						value: '1',
						label: '文科'
					},
					{
						value: '2',
						label: '理科'
					},
					{
						value: '3',
						label: '不分科'
					}
				],
			}
		},
		onLoad(options) {
			
		},
		methods: {
			goto(name) {
				uni.navigateTo({
					url: name
				});
			},
			// 回调参数为包含多个元素的数组，每个元素分别反应每一列的选择情况
			confirm(e) {
				console.log(e);
			}
		}
	}
</script>

<style lang="less" scoped>
	.add-target {
		background-color: #FFFFFF;
		margin-bottom: 20rpx;
	}
	.show-name-title {
		position: relative;
		text-align: center;
		height: 80rpx;
		line-height: 80rpx;
		border-bottom: 1px solid #f1f1f1;
		>view:first-child {
			width: 100rpx;
			position: absolute;
			left: 0;
			top: 0;
		}
		>view:nth-child(2) {
			display: inline-block;
		}
		>view:last-child {
			width: 100rpx;
			position: absolute;
			right: 0;
			top: 0;
		}
	}
</style>
<style>
	page{
		background-color: #f5f5f5;
	}
	.add-target-btn {
		height: 80rpx;
		line-height: 80rpx;
		background-color: #00ca8a;
		color: #FFFFFF;
		text-align: center;
		margin: 100rpx;
		border-radius: 100px;
	}
</style>
